Enable soft delete for workspace backup Recovery Services vaults and fix core public IP lifecycle issues#4907
Enable soft delete for workspace backup Recovery Services vaults and fix core public IP lifecycle issues#4907Copilot wants to merge 12 commits into
Conversation
Agent-Logs-Url: https://github.com/microsoft/AzureTRE/sessions/c847d284-ba5e-406d-ba8d-c5c4eaa47d84 Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
|
@copilot no, dont use azapi: Enabling soft delete does not prevent you from deleting the Backup Vault itself, as long as there are no protected (or soft‑deleted) backup items still in it. So set it explicitly to on. But consider side effects and need to maintain current functionality. Also ensure the azureRm provider is the latest release (pinned). |
Agent-Logs-Url: https://github.com/microsoft/AzureTRE/sessions/09dce1c2-3f0c-4c8a-b9bc-950d78b75e6d Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Addressed in 3d11658. The vault is back on AzureRM, Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the workspace base Terraform template to comply with Azure’s requirement that soft delete is enabled on newly created Recovery Services Vaults, while preserving current workspace deletion/cleanup behavior by ensuring protected items are purged on destroy.
Changes:
- Enable
soft_delete_enabled = truefor the workspace backupazurerm_recovery_services_vault. - Configure AzureRM provider
recovery_servicefeatures to purge protected items and avoid retaining VM backup data on destroy. - Bump the workspace base AzureRM provider pin/lockfile to
4.58.0and update the template version + changelog entry.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| templates/workspaces/base/terraform/providers.tf | Bumps AzureRM to 4.58.0 and configures provider recovery services destroy behavior. |
| templates/workspaces/base/terraform/backup/backup.tf | Enables soft delete on the workspace backup Recovery Services Vault. |
| templates/workspaces/base/terraform/.terraform.lock.hcl | Updates AzureRM provider lock to 4.58.0 and corresponding hashes. |
| templates/workspaces/base/porter.yaml | Bumps tre-workspace-base bundle version to 2.8.4. |
| CHANGELOG.md | Documents the fix under BUG FIXES. |
Files not reviewed (1)
- templates/workspaces/base/terraform/.terraform.lock.hcl: Language not supported
Agent-Logs-Url: https://github.com/microsoft/AzureTRE/sessions/fb2a7fcc-0cc4-47ff-acac-961ef1cb9334 Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/test-extended 43c865c |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/26244326090 (with refid (in response to this comment from @marrobi) |
Moved |
|
@copilot bump API versions so the image can be built |
Bumped |
|
@copilot do we need to update the API version given this is a Terraform change? I'm not sure why the packer template version is getting updated in this PR |
Yes, the bump is required. |
@copilot that's fine, but I see a change has been made to porter.yaml as well and want to make sure this is also required |
Yes, the |
|
/test-extended 4dadc48 |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/26304650650 (with refid (in response to this comment from @rudolphjacksonm) |
|
/test-destroy-env |
|
Destroying PR test environment (RG: rg-tre14403c22)... (run: https://github.com/microsoft/AzureTRE/actions/runs/26309365126) |
|
Destroying branch test environment (RG: rg-tree5944c8a)... (run: https://github.com/microsoft/AzureTRE/actions/runs/26309365126) |
|
Branch test environment destroy complete (RG: rg-tree5944c8a) |
|
@rudolphjacksonm looks like this is maybe being casused by ip_tags on the ap gw pip. Needs ignore_changes too. The dns zone derives the fqdn from it hence the cascade resource "azurerm_private_dns_zone" "nexus" { @copilot add ignore_changes for the app gw pip ip_tags property. |
… replacement Agent-Logs-Url: https://github.com/microsoft/AzureTRE/sessions/de009e2c-bd9e-4c65-a86b-a1939648a2e8 Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Added |
|
/test-extended 713eedd |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/26312937429 (with refid (in response to this comment from @marrobi) |
What is being addressed
Workspace creation with backup enabled can fail when the workspace backup Recovery Services Vault is created with soft delete disabled. Azure now requires soft delete to be enabled for new vaults, so attempts to create the vault with
soft_delete_enabled = falsecan be rejected and leave the workspace deployment stuck.This change also needs to preserve current workspace delete behavior so backup-related resources do not block cleanup.
Additionally, Azure automatically sets
ip_tagson public IPs (e.g."FirstPartyUsage": "/Unprivileged"), which causes Terraform to force replacement of the firewall transit public IP and the application gateway public IP on subsequent applies. This cascades into unnecessary recreation of dependent resources such as private DNS zones.How is this addressed
Recovery Services Vault configuration
azurerm_recovery_services_vaultsoft_delete_enabledargument (removed in AzureRM v4.64.0+); soft delete is now enabled by default on the platformDelete behavior
recovery_servicefeatures to purge protected items from the vault on destroyvm_backup_stop_protection_and_retain_data_on_destroy = falseso workspace cleanup continues to remove backup data rather than retaining itCore infrastructure — public IP lifecycle fixes
ip_tagstolifecycle { ignore_changes = [...] }onazurerm_public_ip.fwtransitincore/terraform/firewall/firewall.tfto prevent forced replacement of the firewall transit public IPip_tagstolifecycle { ignore_changes = [...] }onazurerm_public_ip.appgwpipincore/terraform/appgateway/appgateway.tfto prevent forced replacement of the application gateway public IP and the cascading recreation of dependent DNS zonesProvider/version updates
4.57.0to4.73.0(latest)core/version.txtto0.16.17to satisfy CI version-change enforcement for the core Terraform changesTemplate/versioning
tre-workspace-baseto2.8.4CHANGELOG.mdto describe the AzureRM soft-delete-based fix and public IP lifecycle changes